package com.jhhc.StormSurgeForecast.AstronomicalTide.ServiceImpl;

import com.jhhc.StormSurgeForecast.AstronomicalTide.Service.FileService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
@Service
public class FileServiceImpl implements FileService {
    @Override
    public String uploadLvl(MultipartFile multipartFile, String dir) {
        File file = new File("D:\\work\\数据\\lvl");
        File targetFileName = new File(file, "1.lvl"); // 先写死
        try {
            multipartFile.transferTo(targetFileName);
            return targetFileName.toString();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}
